package com.spring.starter;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author TW
 */
@Configuration
public class CDConfig {
    @Bean("sgtPeppers")
    public CompactDisc randomBeatlesCd(){
        int choice = (int)Math.floor(Math.random()*4);
        if (choice == 0) {
            return  new SgtPeppers();
        } else  if (choice == 1) {
            return new WhiteAlbum();
        } else {
            return new Resolver();
        }
    }
}

